import Layout from "@/components/Layout";
import Login from "@/pages/Login";
import { RouteObject } from "react-router-dom";
import user from "./user";
import topic from "./topic";
import paper from "./paper";
import exam from "./exam";
import student from "./student";
import EditPassword from "@/pages/system/TeacherManage/EditPassword";
import { CreditCardOutlined } from "@ant-design/icons";
import recommend from "./recommend";
import NotFound from "@/pages/NotFound";
export type Route = RouteObject & {
  path: string;
  name?: string;
  element?: React.ReactNode;
  icon?: React.ReactNode;
  children?: Route[];
  component?: React.ReactNode;
  hidden?: boolean;
};

export const menuRoutes = [
  ...user,
  ...topic,
  ...student,
  ...paper,
  ...exam,
  ...recommend,
  {
    path: "editPass",
    name: "修改密码",
    hidden: true,
    icon: <CreditCardOutlined />,
    element: <EditPassword />,
  },
];

const routes: Route[] = [
  {
    path: "/login",
    name: "登录",
    element: <Login />,
  },
  {
    path: "/",
    element: <Layout />,
    children: [...menuRoutes],
  },
  { path: "*", element: <NotFound /> }, 
];

export default routes;
